package com.yonyou.pmclouds.messagenotice.mapper;

import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import com.yonyou.pmclouds.basecom.exception.BusinessException;
import com.yonyou.pmclouds.messagenotice.entity.MessageNoticeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface MessageNoticeMapper extends BaseMapper<MessageNoticeVO> {

    MessageNoticeVO[] getNoticesByUser(@Param("tenantId") String tenantId, @Param("userId") String userId,
                                       @Param("pageStart") int pageStart, @Param("pageSize") int pageSize);

    int countNoticesByUser(@Param("tenantId") String tenantId, @Param("userId") String userId);

    int countUnreadByReceiver(@Param("userId") String receiver);

    void updateNoticeRead(@Param("noticeIds") String noticeIds) throws BusinessException;

    String hasUnreadNotice(@Param("user") String user);
}
